home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 17 / AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso / PD / Anwendungen / AmiCAD / ARexx_english / NewScript.AmiCAD < prev    next >
Text File  |  1998-06-17  |  1KB  |  45 lines

  1. /* NewScript.AmiCAD, 3 Mars 1998 © R.Florac, version 1.00e */
  2. /* This script loads a new script in an editor for editing.
  3.    It's written for my text editor, Amitex. Adapt it to your
  4.    own editor to suit to your needs. */
  5.  
  6. signal on error             /* for error handling */
  7. signal on syntax
  8.  
  9. options results
  10. cr='0a'x
  11.  
  12. port = ADDRESS()                    /* reads the ARexx port name */
  13.  
  14. address command
  15. if ~show(p, "AMITEX") then do
  16.     f=0                 /* the editor was not running */
  17.     'run > nil:' "c:AmiTex"         /* loads the editor */
  18.     waitforport "AMITEX"
  19. end
  20. else f=1                /* it was allready running */
  21.  
  22. ADDRESS(AMITEX)
  23.  
  24. if f=1 then 'NEW("New.AmiCAD")'     /* ask for opening a new window */
  25. 'LOAD("Work:AmiCAD/ARexx/New.AmiCAD")'  /* loads the script "New.AmiCAD" */
  26.  
  27. 'ASK("What''s the name'cr'of this new script ?")'               /* ask for the title */
  28. titre = result||'.AmiCAD'
  29. if titre ~= "" then 'FILENAME("Work:AmiCAD/ARexx/'titre'")'     /* rename the window */
  30. 'GOTO(1,10)'
  31.  
  32. exit
  33.  
  34. /* Traitement des erreurs, interruption du programme */
  35. syntax:
  36. address (port)
  37. erreur=RC
  38. 'MESSAGE("Script NewScript.amiCAD :"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  39. exit
  40.  
  41. error:
  42. address (port)
  43. 'MESSAGE("Script NewScript.amiCAD :"+CHR(10)+"Error in line 'SIGL'")'
  44. exit
  45.